package com.example;

import javax.microedition.khronos.opengles.GL10;

import com.step.Step;
import com.step.mesh.parser.IParser;
import com.step.mesh.parser.Parser;
import com.step.sprite.Sprite.RenderType;
import com.step.sprite.Sprite3D;

public class ObjParserExample extends BaseExample{
	Sprite3D sprite3d;
	@Override
	public void create() {
		
		IParser parser = Parser.createParser(Step.files.internal("model/ship.obj"), true);
		parser.parse();
		sprite3d = parser.getParsedObject();
		sprite3d.setPosition(0, 0, -3);
	}

	@Override
	public void update() {
		GL10 gl = Step.gl;
		gl.glClearColor(1, 1, 1, 1);
		sprite3d.draw(gl,RenderType.TRIANGLES);
		sprite3d.rotate(2);
	}
}
